﻿<Window x:Class="PersistSettingDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="{Binding Source={StaticResource TitlePersistSetting}}" Height="500" Width="400">
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="425*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="2" Name="Grid1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="140*" />
                <ColumnDefinition Width="130" />
                <ColumnDefinition Width="130" />
            </Grid.ColumnDefinitions>
            <Button x:Name="btnOk" Content="{Binding Source={StaticResource PSOk}}" Grid.Column="1" 
                    Click="CommitSettings"
                    Height="35" HorizontalAlignment="Center"  VerticalAlignment="Center" Width="100" />
            <Button x:Name="btnCancel"   Content="{Binding Source={StaticResource PSCancel}}" Grid.Column="2" Height="35" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" IsCancel="True" />
        </Grid>
        <Grid Grid.Row="1" Name="Grid2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="130" />
                <ColumnDefinition Width="270*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition Height="50" />
                <RowDefinition Height="200" />
                <RowDefinition Height="80*" />
            </Grid.RowDefinitions>
            <Label x:Name="lblServerName" Content="{Binding Source={StaticResource PSServerLabel}}" Grid.Row="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
            <Label x:Name="lblDatabaseName" Content="{Binding Source={StaticResource PSDatabaseLabel}}" Grid.Row="1"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
            <Label x:Name="lblAuthority" Grid.Row="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="{Binding Source={StaticResource PSAuthLabel}}" />
            <TextBox x:Name="txtServerName" Grid.Column="1" Height="25" />
            <Grid Grid.Column="1" Grid.Row="2" Name="Grid3">
                <Grid.RowDefinitions>
                    <RowDefinition Height="40" />
                    <RowDefinition Height="160*" />
                </Grid.RowDefinitions>
                <RadioButton x:Name="rdoAuthWindows" Content="{Binding Source={StaticResource PSAuthWindows}}" HorizontalAlignment="Stretch" VerticalAlignment="Center" IsChecked="True" />
                <Grid Grid.Row="1" Name="Grid4">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="120*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="35*" />
                    </Grid.RowDefinitions>
                    <RadioButton  x:Name="rdoAuthSQL" Content="{Binding Source={StaticResource PSAuthSQL}}" HorizontalAlignment="Stretch"  VerticalAlignment="Center" Grid.ColumnSpan="2" />
                    <Label x:Name="lblAccount" Content="{Binding Source={StaticResource PSAuthAccount}}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.Row="1" />
                    <Label x:Name="lblPassword" Content="{Binding Source={StaticResource PSAuthPassword}}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.Row="2" VerticalAlignment="Top" />
                    <TextBox x:Name="txtAccount" Height="25" Grid.Column="1" Grid.Row="1" 
                             IsEnabled="{Binding ElementName=rdoAuthSQL, Path=IsChecked}" />
                    <PasswordBox x:Name="ptxtPassword" Grid.Column="1" Grid.Row="2" 
                                 IsEnabled="{Binding ElementName=rdoAuthSQL, Path=IsChecked}"
                                 Height="25" VerticalAlignment="Top" />
                </Grid>
            </Grid>
            <TextBox x:Name="txtDatabaseName" Height="25" Grid.Column="1" Grid.Row="1" />
            <Button x:Name="btnTestConnect" Content="{Binding Source={StaticResource PSTestConnect}}" Click="ExeucteTestConnect"
                    IsEnabled="{Binding ElementName=rdoAuthSQL, Path=IsChecked}"
                    Height="35"  Width="100" Grid.Column="1" Grid.Row="3" />
        </Grid>
    </Grid>
</Window>
